<?php
$conn=mysql_connect("10.4.12.173","uOV5clKVbW5nQ","pHK7dveNm6Nbd");

if (!$conn)
  {
  die('Could not connect: ' . mysql_error());
  }
mysql_query("SET NAMES 'UTF8'"); 
mysql_select_db("d085d79cbef6743c1a7143b119b80a1fc",$conn);
$i=rand(0,4);
$sql = "SELECT * FROM play_word WHERE id = ".$i;
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
mysql_free_result($result);
mysql_close();

header('Content-type: application/json charset=utf-8');
//获取回调函数名
$jsoncallback = htmlspecialchars($_REQUEST ['jsoncallback']);
//json数据
$json_data = json_encode($row);
//输出jsonp格式的数据
//echo $jsoncallback."(".$json_data.")";
echo $json_data;
?>

